/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Obstacle;
import Character.Character;
import Util.Entity;
import java.awt.Image;
import Game.Game;

/**
 *
 * @author oscar
 * */
 // här skapas en klass som kallas "Block". Den ärver funktioner av "Entity" med hjälp utav "extends".
public class Block extends Entity {

    public Block(int x, int y) {
        super("sprites/block.gif", x, y);
    }
    public Image getImage() {
        return sprite.getImage();
    }
  //  @Override
    public void collidedWith(Character other) {
        if (other instanceof Character) {
            ((Character) other).escape(this.getCollisionBox());
        }
        //TODO Freeze
    }

    @Override
    public void collidedWith(Entity other) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}